<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:th="http://www.thymeleaf.org">
<head lang="en">
    <th:block th:include="/common/lib :: lib"></th:block>
    <link rel="stylesheet" type="text/css" href="/simditor/styles/simditor.css" />


    <script type="text/javascript" src="/simditor/scripts/module.js"></script>
    <script type="text/javascript" src="/simditor/scripts/hotkeys.js"></script>
    <script type="text/javascript" src="/simditor/scripts/uploader.js"></script>
    <script type="text/javascript" src="/simditor/scripts/simditor.js"></script>
</head>

<body>
    <div th:replace="/common/header :: header"></div>

    <div class="container content-main">
        <div class="row">
            <div class="col-lg-3 hidden-md hidden-xs hidden-sm border-right-1">
                <div th:replace="/common/back_left :: back_left"></div>
            </div>
            <div class="col-lg-9 col-md-12 col-sm-12 ">
                <div class="widget ">
                    <h4 class="title">文章管理-修改</h4>


                    <form class="form-horizontal" id="subform" action="/back/article/save" jump="/back/article/list" method="post">
                        <input type="hidden" name="id" th:value="${article.id}"/>
                        <div class="form-group">
                            <label for="title" class="col-sm-2 control-label">文章标题</label>
                            <div class="col-sm-6">
                                <input type="text" class="form-control" id="title" name="title" th:value="${article.title}" placeholder=""/>
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="contentType" class="col-sm-2 control-label">文章类型</label>
                            <div class="col-sm-6">
                                <select id="contentType" name="contentType" class="form-control" >
                                    <th:block th:each="bean : ${contentTypeList}">
                                        <option th:value="${bean.contentType}" th:text="${bean.contentType}"
                                            th:selected="${bean.contentType}==${article.contentType}"></option>
                                    </th:block>
                                </select>
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="col-sm-10 col-sm-offset-1">
                                <textarea id="content" name="content" placeholder="文章内容" autofocus="autofocus" th:text="${content.content}"></textarea>
                            </div>

                        </div>
                        <div class="form-group">
                            <div class="col-sm-offset-3 col-sm-9">
                                <button type="button" class="btn btn-default" onclick="util.submitForm('subform')">修改</button>
                                <button type="button" class="btn btn-default" onclick="util.jump('/back/article/list')">返回</button>
                            </div>
                        </div>

                    </form>
                </div>
            </div>

        </div>

    </div>
</body>

<script>
    $(function(){
        var editor = new Simditor({
            textarea: $('#content'),
            toolbar: ['title','bold','underline','strikethrough','fontScale','color','ol','ul','blockquote',
                'code','table','link','image','hr','indent','outdent','alignment']
        });
    });
</script>
</html>